﻿@model SMECustomerWebsite.Models.ViewModels.DaoManager.ChangeDaoViewModel
@using Common.Data.Repository.Enum;
@using Common.Data;
<div class="col-md-6 col-sm-6 col-xs-12">
    <div class="x_panel">
        <div class="x_title">
            <h2><i class="fa fa-bars"></i> @SMECustomerWebsite.Core.Resources.Resource.Step 1 <small>@SMECustomerWebsite.Core.Resources.Resource.DownloadFileExcel</small></h2>
            <ul class="nav navbar-right panel_toolbox">
                <li>
                    <a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                </li>
            </ul>
            <div class="clearfix"></div>
        </div>
        <div class="x_content">
            @Html.ActionLink("Download Form", "DownloadForm", "DaoManager", new { file = "changeDaoForm.xlsx" }, new { target = "_blank", @id = "exportLicensing", @class = "btn btn-success right", data_toggle = "tooltip", data_placement = "top", title = "", data_original_title = "Get sample excel file" })
        </div>
    </div>
</div>
<div class="col-md-6 col-sm-6 col-xs-12">
    <div class="x_panel">
        <div class="x_title">
            <h2><i class="fa fa-bars"></i> @SMECustomerWebsite.Core.Resources.Resource.Step 2 <small>@SMECustomerWebsite.Core.Resources.Resource.UploadFileExcel</small></h2>
            <ul class="nav navbar-right panel_toolbox">
                <li>
                    <a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                </li>
            </ul>
            <div class="clearfix"></div>
        </div>
        <div class="x_content">
            @using (Html.BeginForm("UploadFormChangeDaoRequest", "DaoManager", FormMethod.Post, new { enctype = "multipart/form-data", @class = "form-horizontal form-label-left" }))
            {
                Html.AntiForgeryToken();
                Html.ValidationSummary(true);
                List<SelectListItem> listReason = new List<SelectListItem>();
                listReason.Add(new SelectListItem
            {
                Text = "--- Lý do của bạn là gì? ---",
                Value = "",
                Selected = true
            });
                var listEnum = Enum.GetValues(typeof(ReasonChangeDaoEnum)).Cast<ReasonChangeDaoEnum>().ToList();
                listEnum.ForEach(x =>
                {
                    listReason.Add(new SelectListItem
                    {
                        Text = EnumHelper<ReasonChangeDaoEnum>.GetDisplayValue(x),
                        Value = ((int)x).ToString(),
                        Selected = false
                    });
                });

                <div class="item form-group">
                    <label class="col-md-12">Lý do * :</label>
                    @Html.DropDownListFor(m => m.Reason, listReason, new { @class = "form-control branch_register", placeholder = "Lý do", required = "required" })
                </div>
                <div class="item form-group">
                    <label class="col-md-12">Nêu rõ giải trình * :</label>
                    @Html.TextBoxFor(m => m.ReasonDescription, new { @class = "form-control", placeholder = "Nêu rõ giải trình" })
                </div>
                <div data-toggle="tooltip" data-placement="right" title="" data-original-title="" class="item form-group">
                    <label class="col-md-12">Chọn file excel đính kèm * :</label>
                    @Html.TextBoxFor(m => m.File, new { @class = "form-control", type = "file", placeholder = "Upload Form" })
                </div>
                if (DateTime.Now.Day <= 5)
                {
                    <div class="item form-group">
                        <div class=" checkbox">
                            <label>
                                @Html.CheckBoxFor(m => m.IsDeviation, new { }) Yêu cầu tính kết quả cho tháng trước
                            </label>
                        </div>
                    </div>
                }
                <div>
                    <button type="submit" class="btn btn-success right" value="Upload">Submit</button>
                </div>
            }
        </div>
    </div>
</div>